/* Doesnt' work. Why? */
//AjaxLab.Engine.Plugins.BaseCommands.callBaseMethod(this, 'registerCommands',[customCommands]);

/*
		Will it be better to use delegate and have users define their own method instead? lik
		this.registerCommandProcess(custoCommand, commandCallBack, commandCallBackContext);
		
		CMDUtil.js is avaiable for plug in classes to use. - this.Console
*/
	
Type.registerNamespace("AjaxLab.Engine.Plugins");
AjaxLab.Engine.Plugins.AjaxLabNavigation= function()
{
	var customCommands = "GoTo|Nav";
	var instance = this;
	AjaxLab.Engine.Plugins.AjaxLabNavigation.initializeBase(this);
	this.registerCommands(customCommands);
	
	/* Implement the Plug In here */
	
	this.processCommands = function(inputtext) {
		var failed = false;
		var command     = inputtext.split(" ");
		if (command == null)
		{
			instance.Log4J.Debug("Navigiation commands are null");
		}
		
		if(command[0].toUpperCase() == "GOTO" || "NAV")
		{
			if(command[1].toUpperCase() == "N0")
			{
				Effect.Appear('n0');
				$('n1').style.display="none";
				$('n2').style.display="none";
				$('n3').style.display="none";
				$('n4').style.display="none";
				$('n5').style.display="none";
				$('n6').style.display="none";
				$('n7').style.display="none";
			}
			else if(command[1].toUpperCase() == "N1")
			{
				$('n0').style.display="none";
				Effect.Appear('n1');
				$('n2').style.display="none";
				$('n3').style.display="none";
				$('n4').style.display="none";
				$('n5').style.display="none";
				$('n6').style.display="none";
				$('n7').style.display="none";
			}
			else if(command[1].toUpperCase() == "N2")
			{
				$('n0').style.display="none";
				$('n1').style.display="none";
				Effect.SlideDown('n2');
				$('n3').style.display="none";
				$('n4').style.display="none";
				$('n5').style.display="none";
				$('n6').style.display="none";
				$('n7').style.display="none";
			}
			else if(command[1].toUpperCase() == "N3")
			{
				$('n0').style.display="none";
				$('n1').style.display="none";
				$('n2').style.display="none";
				$('n3').style.display="";
				$('n4').style.display="none";
				$('n5').style.display="none";
				$('n6').style.display="none";
				$('n7').style.display="none";
			}
			else if(command[1].toUpperCase() == "N4")
			{
				$('n0').style.display="none";
				$('n1').style.display="none";
				$('n2').style.display="none";
				$('n3').style.display="none";
				Effect.Appear('n4');
				$('n6').style.display="none";
				$('n7').style.display="none";
			}
			else if(command[1].toUpperCase() == "N5")
			{
				$('n0').style.display="none";
				$('n1').style.display="none";
				$('n2').style.display="none";
				$('n3').style.display="none";
				$('n4').style.display="none";
				$('n5').style.display="";
				$('n6').style.display="none";
				$('n7').style.display="none";
			}
			else if(command[1].toUpperCase() == "N6")
			{
				$('n0').style.display="none";
				$('n1').style.display="none";
				$('n2').style.display="none";
				$('n3').style.display="none";
				$('n4').style.display="none";
				$('n5').style.display="none";
				Effect.BlindDown('n6');
				$('n7').style.display="none";
			}
			else if(command[1].toUpperCase() == "N7")
			{
				$('n0').style.display="none";
				$('n1').style.display="none";
				$('n2').style.display="none";
				$('n3').style.display="none";
				$('n4').style.display="none";
				$('n5').style.display="none";
				$('n6').style.display="none";
				Effect.toggle('n7','blind');
			}
			else 
			{
					failed = true;
					instance.Console.printToConsole(inputtext+" is not recognized as an internal or external navigation command");
			}
			if(failed==false)
			{
				instance.Console.newPrompt();
			}
		}
    }
}
AjaxLab.Engine.Plugins.AjaxLabNavigation.registerClass('AjaxLab.Engine.Plugins.AjaxLabNavigation', AjaxLab.Engine.Abstract.Commands);




